﻿using System;
using System.Data;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class Webadmin_Modules_Order_ListEdit : bzAdminUCBase
{
    public string _ID = "";
    public string _Act = "";
    private DataTable _dt = new DataTable();
    private bzOrder bz = new bzOrder();
    public DataRow dr = null;
    override protected void loadAction()
    {
        _Act = Request.QueryString["Act"] == null ? "" : Request.QueryString["Act"];
        _ID = Request.QueryString["ID"] == null ? "-1" : Request.QueryString["ID"];
        _dt = bz.getRecord(_ID, "-1");
        if (_dt.Rows.Count > 0)
        {
            dr = _dt.Rows[0];
        }
        if (!IsPostBack)
        {
            switch (_Act)
            {
                case "Edit": this.loadEdit(); break;
            }
        }
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        this.initSiteLang(bzSiteOption.Group.Administrator, bzSiteOption.Note.Product, "Product");
    }
    private void loadEdit()
    {
        bz.updateRecord(_ID, "0");
        this.Navigator = this.AdminLang["MenuOrder"].ToString() + this.AdminLang["GeneralArrow"].ToString() + this.AdminLang["MenuOrderBuy"].ToString() + this.AdminLang["GeneralArrow"].ToString() + this.AdminLang["Edit"].ToString();
        _dt = bz.getRecord(_ID, "-1");
        dr = _dt.Rows[0];
        this.txtTitle.Text = dr["TitleVN"].ToString();
        this.txtPrice.Text = bzStringClass.formatNumber(dr["Price"]);
        this.txtPostedDate.Text = bzStringClass.getStringDate(dr["RegisterDate"].ToString(),this.CurrentLang);
        this.txtPhone.Text = dr["Phone"].ToString();
        //this.txtPayment.Text = bzStringClass.formatNumber(dr["Payment"]);
        this.txtNameFull.Text = dr["NameFull"].ToString();
       // this.txtFistPayment.Text = dr["FirstPay"].ToString();
       // this.txtFistMonth.Text = bzStringClass.formatNumber(dr["FirstMonth"]);
       // this.txtEndMonth.Text = bzStringClass.formatNumber(dr["EndMonth"]);
        this.txtEmail.Text = dr["Email"].ToString();
       // this.txtDatePayment.Text = dr["DatePay"].ToString();
        this.txtCMND.Text = dr["CMND"].ToString();
        this.txtAddress.Text = dr["Address"].ToString();
    }    
}
